<template>
  <div id="tab" class="tab-box">
    <ul>
      <li v-for="(item, index) in navList" :class="{actived: actived == index}" @click="navChange(index)">
        <div class="icon-box flex_box horizontal vertical">
          <i class="i-icon" :class="{iconed: iconed == (index+1)}"></i>
        </div>
        <p v-text="item.name">设备登记信息</p>
      </li>
    </ul>
  </div>
</template>


<script>
  export default {
    name: "tab",
    data() {
      return {
        actived: 0,
        iconed: 1,
        navList: [
          {
            name: '设备登记信息'
          },
          {
            name: '设备使用信息'
          },
          {
            name: '设备安装信息'
          },
          {
            name: '巡检保险信息'
          },
          {
            name: '电梯记录'
          },
          {
            name: '物联设备'
          }
        ]
      }
    },
    methods: {
      navChange(index) {
        const self = this
        self.actived = index
        self.iconed = index + 1
        this.$emit('on-change', index);
      }
    }
  }
</script>


<style lang="scss" type="text/scss">
  @import "tab";
</style>
